home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / develop / libsrc11.arc / RDBLKSC9.C < prev    next >
Text File  |  1989-06-27  |  1KB  |  38 lines

  1. /*    rdblksc9.c 4.2        */
  2. /*F****************************************************************************
  3.  
  4. FUNCTION NAME:    rdblksc9
  5.  
  6. ACTION:        Read count characters from the SCI serial hardware
  7.         into an array of integer.
  8.  
  9. PARAMETERS:
  10.         array:    address of an array of integers to be written to.
  11.  
  12.         count:    number of integers to read from port C.
  13.  
  14. RETURNS:    (void)
  15.  
  16. ******************************************************************************/
  17.  
  18. #include <hc11/directives.h>
  19.  
  20. SMALL
  21. void rdblksc9(array, count)
  22.  
  23.     int    *array;        /* pointer to data to be read */
  24.     int    count;        /* number of bytes to be read */
  25.  
  26.     {
  27.  
  28.     /****************************************************************/
  29.     /*    Note that "while ((count--) > 0)" is equivalent to    */
  30.     /*    "while ((--count) >= 0)" but the pre-decrement version    */
  31.     /*    is more efficient than the post-decrement version.    */
  32.     /****************************************************************/
  33.      
  34.     while ((--count) >= 0)
  35.         *(array++) = rdbytsc();
  36.  
  37.     }    /* end of rdblksc9    */
  38.